<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>伸缩盒主轴换行</title>
    <style>
        .outer {
            width: 1000px;
            height: 600px;
            background-color: #888;
            margin: 0 auto;
            display: flex;
            /* 主轴方向排列的元素，即使多了也不会换行，会挤在一起，宽变窄了,这体现了缩 */

            /* 主轴换行方式,nowrap不换行,wrap一行装不下就换行,但是上面会有大缝隙,应该说侧轴有间隙 */
            /* 当非要挤在一起装不下时才会挤在一起 */
            flex-wrap: wrap;
            /*这个reverse是指从最下面开始排,不建议用，用的最多的是wra[*/
            /*flex-wrap: wrap-reverse;*/

            
        }

        .inner {
            width: 200px;
            height: 198px;
            border: 1px solid black;
            background-color: skyblue;
        }

    </style>
</head>
<body>
<div class="outer">
    <div class="inner inner1">1</div>
    <div class="inner inner2">2</div>
    <div class="inner inner3">3</div>
    <div class="inner inner4">4</div>
    <div class="inner inner5">5</div>
    <div class="inner inner6">6</div>
    <div class="inner inner7">7</div>
    <div class="inner inner7">8</div>


</div>


</body>
</html>